package Laboratorio;

import java.sql.*;

public class ListaGiocatori {

	public static void stampaListaGiocatori() throws ClassNotFoundException,
			SQLException {
		Class.forName("com.mysql.jdbc.Driver");
		Connection con = DriverManager.getConnection(
				"jdbc:mysql://localhost:3306/test", "root", "pollpollo");
		PreparedStatement statement = con.prepareStatement("select * from gsa");
		ResultSet result = statement.executeQuery();
		while (result.next()) {
			System.out.println(result.getInt(1) + " " + result.getString(2)
					+ " " + result.getString(3) + " " + result.getString(4)
					+ " " + result.getInt(5));
		}
	}

	public static void main(String[] args) throws Exception {
		stampaListaGiocatori();
	}
}